package com.minivision.bus.event;

import org.springframework.cloud.bus.event.RemoteApplicationEvent;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

/**
 * 自定义Spring Cloud Bus消息传递事件用来传递消息总线上的消息
 * @author hughzhao
 * @2018年3月1日
 */
@Setter
@Getter
@ToString
@NoArgsConstructor
public class RemoteBusEvent extends RemoteApplicationEvent {

  private static final long serialVersionUID = 6277896105085364077L;
  
  //消息类型，指明message字段代表的消息内容的含义
  private String type;
  //消息内容，通常为json字符串
  private String message;
  
  public RemoteBusEvent(String originService, String type, String message) {
    super(RemoteBusEvent.class, originService);
    this.type = type;
    this.message = message;
  }

}
